﻿<!-- #Include File="../Include/Function.asp" -->
<!-- #Include File="../Include/Md5.asp" -->
<!-- #include file="Include/Admin_Menu_Type.asp" -->
<%
Select Case Action
Case "ScreenLock"
    Call ScreenLock()
Case Else
    Call Main()
End Select
Call CloseConn()

Sub Main()
	If Cookies_Get(Cookies_For&"Admin") <> "GongXiang_Admin" Or Cookies_Get(Cookies_For&"AdminUsername") = "" Or Cookies_Get(Cookies_For&"AdminPassword") = "" Or Cookies_Get(Cookies_For&"AdminRndPassword") = "" Or (Web_AdminCodes <> "" And Cookies_Get(Cookies_For&"AdminLoginCode") <> Web_AdminCodes) Then
		Session_Delele()
		Cookies_Delele()
		Call Format_Redirect("Admin_Login.asp")
	End If
	sqlGetAdmin = "select * from Admin where UserName='" & Cookies_Get(Cookies_For&"AdminUsername") & "' and Password='" & Cookies_Get(Cookies_For&"AdminPassword") & "'"
	Call Exe_Conn(rsGetAdmin,sqlGetAdmin,1)
	If rsGetAdmin.BOF And rsGetAdmin.EOF Then
		rsGetAdmin.Close
		Set rsGetAdmin = Nothing
		Call CloseConn()
		Session_Delele()
		Cookies_Delele()
		Response.Redirect "Admin_Login.asp"
	Else
		If rsGetAdmin("EnableMultiLogin") <> True And Trim(rsGetAdmin("RndPassword")) <> Cookies_Get(Cookies_For&"AdminRndPassword") Then
			Session.Codepage = 65001
			Response.Charset = "utf-8"
			Response.Write "<br><p align='center'><font color='red'>对不起，为了系统安全，本系统不允许两个人使用同一个管理员帐号进行登录！</font></p><p align='center'>因为现在有人已经在其他地方使用此管理员帐号进行登录了，所以你将不能继续进行后台管理操作。</p><p align='center'>你可以<a href='Admin_Login.asp' target='_top'>点此重新登录</a>。</p>"
			rsGetAdmin.Close
			Set rsGetAdmin = Nothing
			Call CloseConn()
			Session_Delele()
			Cookies_Delele()
			Response.End()
		End If
		If rsGetAdmin("IsOpen") = False Then
			Session_Delele()
			Cookies_Delele()
			Response.Redirect "Admin_Login.asp"
			Response.End()
		End If
	End If
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel='shortcut icon' href='Images/favicon.ico' />" & vbCrLf
	Response.Write "<title>" & SiteName & "--后台管理</title>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href=""Plugins/layui/css/layui.css"" rel=""stylesheet"" type=""text/css"" />" & vbCrLf
	Response.Write "<link href=""Style/global.css"" rel=""stylesheet"" type=""text/css"" />" & vbCrLf
	Response.Write "<link href=""Style/font.css"" rel=""stylesheet"" type=""text/css"" />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""Js/Admin.js""></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var navs = [" & Admin_Menu(0) & "];" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	Response.Write "<div class=""layui-layout layui-layout-admin"">" & vbCrLf
	Response.Write "    <div class=""layui-header header"">" & vbCrLf
	Response.Write "        <div class=""layui-main"">" & vbCrLf
	Response.Write "            <div class=""admin-login-box"">" & vbCrLf
	Response.Write "                <a class=""logo"" style=""left: 0;"" href=""/Admin/Admin_Index.asp"">" & vbCrLf
	Response.Write "                    <span style=""font-size: 22px;"">开心网络</span>" & vbCrLf
	Response.Write "                </a>" & vbCrLf
	Response.Write "                <div class=""admin-side-toggle fs1"">" & vbCrLf
	Response.Write "                    <span class=""icon icon-menu""></span>" & vbCrLf
	Response.Write "                </div>" & vbCrLf
	Response.Write "                <div class=""admin-side-full"">" & vbCrLf
	Response.Write "                    <span class=""icon icon-enlarge""></span>" & vbCrLf
	Response.Write "                </div>" & vbCrLf
	Response.Write "            </div>" & vbCrLf
	Response.Write "            <ul class=""layui-nav admin-header-item"" lay-filter=""side-top-right"">" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a href=""" & InstallDir & ""
	Select Case Web_IsCreatIndexShow
	Case True
		Response.Write Web_IndexShowFile
	Case Else
		Response.Write IndexShow
	End Select
	Response.Write """ target=""_blank""><i class=""fa fa-home""></i><cite>浏览网站</cite></a>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a class=""name"" href=""javascript:void(0);""><i class=""fa fa-tachometer""></i><cite>生成</cite></a>" & vbCrLf
	Response.Write "                    <dl class=""layui-nav-child"">" & vbCrLf
	Response.Write "                        <dd><a href=""javascript:void(0);"" onClick=""tab.tabAdd({'id': 1,'href': 'Admin\/Admin_CreateShow.asp','title': '" & ToUnicode("生成首页") & "'});"">生成首页</a></dd>" & vbCrLf
	Response.Write "                        <dd><a href=""javascript:void(0);"" onClick=""tab.tabAdd({'id': 1,'href': 'Admin\/Admin_CreateIndex.asp','title': '" & ToUnicode("生成导页") & "'});"">生成导页</a></dd>" & vbCrLf
	Response.Write "                    </dl>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a class=""name"" href=""javascript:void(0);""><i class=""layui-icon"">&#xe61b;</i><cite>主题</cite></a>" & vbCrLf
	Response.Write "                    <dl class=""layui-nav-child"">" & vbCrLf
	Response.Write "                        <dd data-skin=""0""" & Check_Object2(Trim(Request.Cookies("skin")),""," class=""layui-this""") & "><a href=""javascript:void(0);"">默认主题</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvingclassic""" & Check_Object2(Trim(Request.Cookies("skin")),"zvingclassic"," class=""layui-this""") & "><a href=""javascript:void(0);"">经典蓝色</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvinggreen""" & Check_Object2(Trim(Request.Cookies("skin")),"zvinggreen"," class=""layui-this""") & "><a href=""javascript:void(0);"">清新绿色</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvingdeep""" & Check_Object2(Trim(Request.Cookies("skin")),"zvingdeep"," class=""layui-this""") & "><a href=""javascript:void(0);"">雅致深色</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvingred""" & Check_Object2(Trim(Request.Cookies("skin")),"zvingred"," class=""layui-this""") & "><a href=""javascript:void(0);"">庄重红色</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvingpurple""" & Check_Object2(Trim(Request.Cookies("skin")),"zvingpurple"," class=""layui-this""") & "><a href=""javascript:void(0);"">优雅紫色</a></dd>" & vbCrLf
	Response.Write "                        <dd data-skin=""zvingflat""" & Check_Object2(Trim(Request.Cookies("skin")),"zvingflat"," class=""layui-this""") & "><a href=""javascript:void(0);"">明快扁平</a></dd>" & vbCrLf
	Response.Write "                    </dl>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "                <li class=""layui-nav-item lockcms"">" & vbCrLf
	Response.Write "                    <a href=""javascript:void(0);""><i class=""fa fa-lock""></i><cite>锁屏</cite></a>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a href=""javascript:void(0);"" class=""admin-header-user"">" & vbCrLf
	Response.Write "                        <img src=""Images/face.jpg"" class=""layui-nav-img"" />" & vbCrLf
	Response.Write "                        <span>" & Cookies_Get(Cookies_For&"AdminUsername") & "</span>" & vbCrLf
	Response.Write "                    </a>" & vbCrLf
	Response.Write "                    <dl class=""layui-nav-child"">" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" onClick=""tab.tabAdd({'id': 1,'href': 'Admin\/Admin_ModifyPwd.asp','title': '" & ToUnicode("修改密码") & "'});""><i class=""fa fa-edit"" aria-hidden=""true""></i><cite>修改密码</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" onClick=""tab.tabAdd({'id': 1,'href': 'Admin\/Admin_Maillist.asp','title': '" & ToUnicode("发送邮件") & "'});""><i class=""fa fa-envelope-open-o"" aria-hidden=""true""></i><cite>发送邮件</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" onClick=""tab.tabAdd({'id': 1,'href': 'Admin\/Admin_Help.asp','title': '" & ToUnicode("帮助中心") & "'});""><i class=""fa fa-info-circle"" aria-hidden=""true""></i><cite>帮助中心</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" onClick=""IsLogoutConfirm('您确定要退出管理后台吗？','Admin_Login.asp?Action=Logout');""><i class=""fa fa-sign-out"" aria-hidden=""true""></i><cite>退出</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                    </dl>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "            </ul>" & vbCrLf
	Response.Write "            <ul class=""layui-nav admin-header-item-mobile"">" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a href=""" & InstallDir & IndexShow & """ target=""_blank""><i class=""fa fa-home""></i>浏览网站</a>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "                <li class=""layui-nav-item"">" & vbCrLf
	Response.Write "                    <a href=""javascript:void(0);"" class=""admin-header-user"">" & vbCrLf
	Response.Write "                        <img src=""Images/face.jpg"" class=""layui-nav-img"" />" & vbCrLf
	Response.Write "                        <span>" & Cookies_Get(Cookies_For&"AdminUsername") & "</span>" & vbCrLf
	Response.Write "                    </a>" & vbCrLf
	Response.Write "                    <dl class=""layui-nav-child"">" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" class=""lockcms""><i class=""fa fa-lock"" aria-hidden=""true""></i><cite>锁屏</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                        <dd>" & vbCrLf
	Response.Write "                            <a href=""javascript:void(0);"" onClick=""IsLogoutConfirm('您确定要退出管理后台吗？','Admin_Login.asp?Action=Logout');""><i class=""fa fa-sign-out"" aria-hidden=""true""></i><cite>退出</cite></a>" & vbCrLf
	Response.Write "                        </dd>" & vbCrLf
	Response.Write "                    </dl>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "            </ul>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "    <div class=""layui-side layui-bg-black"" id=""admin-side"">" & vbCrLf
	Response.Write "        <div class=""layui-side-scroll"" id=""admin-navbar-side"" lay-filter=""side""></div>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "    <div class=""layui-body"" style=""bottom: 0;border-left: solid 2px #1AA094;"" id=""admin-body"">" & vbCrLf
	Response.Write "        <div class=""layui-tab admin-nav-card layui-tab-brief"" lay-filter=""admin-tab"">" & vbCrLf
	Response.Write "            <ul class=""layui-tab-title"">" & vbCrLf
	Response.Write "                <li class=""layui-this"">" & vbCrLf
	Response.Write "                    <i class=""icon icon-earth"" aria-hidden=""true""></i>" & vbCrLf
	Response.Write "                    <cite>控制面板</cite>" & vbCrLf
	Response.Write "                </li>" & vbCrLf
	Response.Write "            </ul>" & vbCrLf
	Response.Write "            <div class=""layui-tab-content"" style=""min-height: 150px; padding: 5px 0 0 0;"">" & vbCrLf
	Response.Write "                <div class=""layui-tab-item layui-show"">" & vbCrLf
	Response.Write "                    <iframe id=""main"" name=""main"" src=""Admin_WebInfo.asp""></iframe>" & vbCrLf
	Response.Write "                </div>" & vbCrLf
	Response.Write "            </div>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "    <div class=""layui-footer footer footer-demo"" id=""admin-footer"">" & vbCrLf
	Response.Write "        <div class=""layui-main"">" & vbCrLf
	Response.Write "            <p>Copyright&nbsp;&copy;&nbsp;2006-<script language=""JavaScript"">document.write(new Date().getFullYear());</script>&nbsp;<a href=""http://www.kaixin100.cn/"" target=""_blank"" class=""footcopy"">www.kaixin100.cn</a>&nbsp;,&nbsp;All&nbsp;Rights&nbsp;Reserved." & CHR(32)&CHR(80)&CHR(111)&CHR(119)&CHR(101)&CHR(114)&CHR(101)&CHR(100)&CHR(32)&CHR(66)&CHR(121)&CHR(32)&CHR(87)&CHR(97)&CHR(110)&CHR(103)&CHR(75)&CHR(97)&CHR(105)&CHR(67)&CHR(77)&CHR(83)&CHR(32)&SystemEdition&CHR(32)&CHR(118)&SystemVersion&CHR(40)&Replace(Replace(Replace(SystemDatabaseType,0,"ACCESS"),1,"MSSQL"),2,"MYSQL")&CHR(41)&CHR(32)&SystemBuildDate&CHR(32)&CHR(40)&Charset&CHR(41) & "</p>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "    <div class=""site-tree-mobile layui-hide"">" & vbCrLf
	Response.Write "        <i class=""layui-icon"">&#xe602;</i>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "    <div class=""site-mobile-shade""></div>" & vbCrLf
	Response.Write "    <script src=""Js/index.js""></script>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	Response.Write "</body>" & vbCrLf
	Response.Write "</html>"
End Sub

Sub ScreenLock()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		If Cookies_Get(Cookies_For&"AdminUsername") = "" Then
			Response.Write "{""code"":2,""msg"":""\u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u5148\u767b\u5f55\uff01""}" & vbCrLf
			Response.End()
		End If
		Password = Trim(Code_Form("lock_password"))
		sqlGetAdmin = "select * from Admin where UserName='" & Cookies_Get(Cookies_For&"AdminUsername") & "' and Password='" & Encryptstr(Password) & "' and IsOpen=True"
		Call Exe_Conn(rsGetAdmin,sqlGetAdmin,1)
		If rsGetAdmin.BOF And rsGetAdmin.EOF Then
			rsGetAdmin.Close
			Set rsGetAdmin = Nothing
			Call CloseConn()
			Response.Write "{""code"":0,""msg"":""\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01""}" & vbCrLf
			Response.End()
		Else
			Response.Write "{""code"":1,""msg"":""\u6210\u529f\uff01""}" & vbCrLf
			Response.End()
		End If
	End If
End Sub

Function Admin_Bottom()
	Response.Redirect "Admin_Bottom.asp?ButtonSymbol=Disabled&OpStr=" & Server.URLEncode("系统管理中心 >> <font color=red>首页</font>") & ""
End Function
%>